#ifndef CACHEITEM_H
#define CACHEITEM_H

#include "ngl/Obj.h"

#include "vector"

/// @enum CacheItemType type of cache item
enum CacheItemType
{
    FLUID_CACHE,            ///< cache item of fluid particles
    BOUNDARY_CACHE,         ///< cache item of the boundary
    SPHERE_CACHE,           ///< cache item of spheres rbd
    CAPSULE_CACHE           ///< cache item of capsules rbd
};


/// @file CacheItem.h
/// @brief hold an item (fluid, rbd or boundary) that will be written to disk as a single file
/// @author Perseedoss Rajiv
/// @version 1.0
/// @date 09.08.11
/// Revision History :
/// Initial Version 09.08.11
/// @class CacheItem
/// @brief store a list of positions per frame and is flushed to disk by the Cache class


class CacheItem
{
public:
    /// @brief ctor
    /// @param[in] _positionList the list of positions
    /// @param[in] _nameList the list of names
    /// @param[in] _frameNumber the current frame number
    /// @param[in] _cacheItemType the type of cache item
    CacheItem
    (
        const std::vector<std::vector<ngl::Vector> > _positionList,
        const std::vector<std::string> _nameList,
        const int _frameNumber,
        const CacheItemType _cacheItemType
    );

    /// @brief copy ctor
    /// @param[in] _cacheItem the copied object
    CacheItem(const CacheItem& _cacheItem);

    /// @brief return the frame number
    inline int getFrameNumber() const { return m_frameNumber; }

    /// @brief return the list of positions
    inline std::vector<std::vector<ngl::Vector> > getPositionList() const { return m_positionList; }

    /// @brief return the list of names
    inline std::vector<std::string> getNameList() const { return m_nameList; }

    /// @brief return the type of the cache item
    inline CacheItemType getCacheItemType() const { return m_cacheItemType; }

private:
    /// @brief the type of cache item being exported
    CacheItemType m_cacheItemType;

    /// @brief the list of positions
    std::vector<std::vector<ngl::Vector> > m_positionList;

    /// @brief the list of names
    std::vector<std::string> m_nameList;

    /// @brief the frame number
    int m_frameNumber;

};

#endif // CACHEITEM_H
